<?php

/*
 * This is my first OOP project. This is a test project!
 * The name of project is Bookstore. 
 */

/**
 * This class is handling session.
 * @author Velislav Belev
 * @license   http://opensource.org/licenses/gpl-3.0.html GNU Public License
 */
namespace Models;
class MySession {
    
    public function __construct() {
        $this->mySessionStart($session_name='books',$lifetime=7200, $host='localhost');
    }

    public function mySessionStart ($session_name='books',$lifetime=7200, $host='localhost') {
        session_start();
        session_name($session_name);
    session_set_cookie_params($lifetime,'/', 'localhost', FALSE, TRUE);

   }
   
   public function mySessionDestroy ($session_name='books', $redirect='index.php') {
    session_destroy();
    header('Location:'. $redirect.'');
    exit;
   }

    
    
    
    
}
